package com.yl.users.common.enum

import com.baomidou.mybatisplus.annotation.EnumValue
import com.fasterxml.jackson.annotation.JsonValue

/***
 * 用户包专用用类型枚举
 */
enum class UserPackageTypeEnum (@EnumValue val code:Int,@JsonValue val typeName:String){

	//1-30 用户类型
	COMPANY_USER_TYPE_DOCTOR(1,"医生"),
	COMPANY_USER_TYPE_NURSE(2,"护士"),
	COMPANY_USER_TYPE_CONSULT(3,"咨询师"),
	COMPANY_USER_TYPE_FRONT_DESK(4,"前台"),
	COMPANY_USER_TYPE_ONLINE_MARKETING(5,"网电营销"),
	COMPANY_USER_TYPE_CUSTOMER_SERVICE(6,"客服"),
	COMPANY_USER_TYPE_THE_ADMINISTRATOR(7,"管理员"),
	COMPANY_USER_TYPE_LIBRARY_TUBE(8,"库管"),
	COMPANY_USER_TYPE_DENTAL_ASSISTANTS(9,"牙医助理"),
	COMPANY_USER_TYPE_FINANCIAL(10,"财务"),

	COMPANY_USER_TYPE_CASHIER(11,"收银员"),//查询用
	//31 - 40 性别
	USER_GENDER_BOY(31,"男"),
	USER_GENDER_GIRL(32,"女"),

	OTHER(999,"其他");

	companion object {
		fun getEnum(d: Int?): UserPackageTypeEnum {
			return values()
				.find { it.code == (d ?: return OTHER) } ?: OTHER
		}

		fun getEnumByName(d: String?): UserPackageTypeEnum {
			return values()
				.find { it.typeName == (d ?: return OTHER) } ?: OTHER
		}
	}

	fun getMap():MutableMap<String,Any>{
		val map = mutableMapOf<String,Any>()
		map["id"] = this.typeName
		map["name"] = this.typeName
		return map
	}

}
